package wondersgroup.hsswidget.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.ScrollView;


import butterknife.Bind;
import butterknife.ButterKnife;
import wondersgroup.hsswidget.adapter.AdapterUtil;
import wondersgroup.hsswidget.R;

/**
 * <b>Project:</b> View Test<br>
 * <b>Create Date:</b> 2016/9/25 0025<br>
 * <b>Author:</b> huang saisai <br>
 * <b>Description:</b> <br>
 */
public class ListViewInScrollview extends Fragment {

    @Bind(R.id.lv)
    ListView lv;
    @Bind(R.id.scrollview)
    ScrollView scrollview;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater,
                             @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_listview_in_scrolview,
                                     container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        lv.setAdapter(AdapterUtil.createStringAdapter(getContext(), AdapterUtil.createStringList(20)));
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
